<template>
  <view>
    <view class="cart-container animate__animated animate__backInLeft" v-if="cart.length!==0&&token!==''">
      <my-address></my-address>
      <!-- 购物车商品列表的标题区域 -->
      <view class="cart-title">
        <!-- 左侧的图标 -->
        <uni-icons type="shop" size="18"></uni-icons>
        <!-- 描述文本 -->
        <text class="cart-title-text">壁纸集</text>
      </view>
      <!--  -->
      <my-imageslist :cart="cart" :wh='wh' :show-radio="true" @delet='imagesclickhander'></my-imageslist>
      <ad unit-id="adunit-81c6afda227176ac" ad-type="video" ad-theme="white"></ad>
    </view>
    <!--  -->
    <my-resources v-else></my-resources>
  </view>
</template>

<script>
  import badgeMix from '@/mixins/tabbar-badge.js'
  import timer from '@/mixins/token-timer.js'
  import {
    mapState,
    mapMutations
  } from 'vuex'
  export default {
    mixins: [badgeMix,timer],
    computed: {
      ...mapState('m_cart', ['cart']),
      ...mapState('m_user', ['token'])
    },
    data() {
      return {
        wh: 0,
        routename:"/pages/cart/cart",
      };
    },
    onLoad() {
      const sysInfo = uni.getSystemInfoSync()
      this.wh = sysInfo.windowHeight
    },

    methods: {
      ...mapMutations('m_cart', ['removeGoodsByimg']),
      imagesclickhander(e) {
        this.removeGoodsByimg(e)
        uni.$showMsg('已删除！')
      },
      
    }
  }
</script>

<style lang="scss">
  .cart-title {
    height: 40px;
    display: flex;
    align-items: center;
    font-size: 14px;
    padding-left: 5px;
    border-bottom: 1px solid red;

    .cart-title-text {
      margin-left: 10px;
    }
  }
</style>
